package com.big_data_studio.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.big_data_studio.entity.RoleMenu;
import com.big_data_studio.mapper.RoleMenuMapper;
import com.big_data_studio.service.IRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements IRoleMenuService {
    @Autowired
    IRoleMenuService iRoleMenuService;
    @Override
    public List<RoleMenu> getMenuByRoleId(int rid) {
        QueryWrapper<RoleMenu> wrapper=new QueryWrapper<>();
        wrapper.eq("role_id",rid);
        return iRoleMenuService.list(wrapper);
    }

    @Override
    public List<RoleMenu> getMenuByRoleId(List<Integer> rids) {
        QueryWrapper<RoleMenu> wrapper=new QueryWrapper<>();
        wrapper.in("role_id",rids);
        return iRoleMenuService.list(wrapper);
    }
}
